 
import type { EChartsOption } from 'echarts';
import * as echarts from 'echarts';
import { unref, nextTick, watch, computed, ref } from 'vue';
import type { Ref } from 'vue';
export function useEcharts(
    elRef:Ref<HTMLDivElement>,
    theme:'light'
){
    let chartInstance: echarts.ECharts | null = null;
    const el = unref(elRef);  
    let t = theme;
    chartInstance = echarts.init(el, t);
    window.addEventListener('resize',()=>{
        chartInstance?.resize();
    })
    return chartInstance
}


